Skip to content

Conversation

sparrowDom
Copy link
Member

Etherscan has migrated to V2 api for the contract verification. There are guides on how to migrate, but I couldn't get a workable combination of packages. Increasing some of the versions also introduces great breaking changes.

This PR finds a workaround on how to verify contracts by forcing a V2 api with the necessary chainId get parameter without any changes to the installed packages

@codecov
Copy link

codecov bot commented Oct 3, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 35.37%. Comparing base (6c5c3a1) to head (279bfaa).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #2679   +/-   ##
=======================================
  Coverage   35.37%   35.37%           
=======================================
  Files         112      112           
  Lines        5331     5331           
  Branches     1412     1412           
=======================================
  Hits         1886     1886           
  Misses       3444     3444           
  Partials        1        1           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

naddison36
naddison36 previously approved these changes Oct 7, 2025
Copy link
Collaborator

@naddison36 naddison36 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not great that hardhat-etherscan no longer works but it'll have to do for now. hardhat-verify works but it a pain when there are constructor parameters. It's manageable, though.

```
npx hardhat --network mainnet verify --contract contracts/vault/VaultAdmin.sol:VaultAdmin 0x31a91336414d3B955E494E7d485a6B06b55FC8fB
```

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add an example with a constructor parameter. This one is from the deployment template in Notion

echo "module.exports = [{
  platformAddress: \"0x0000000000000000000000000000000000000001\",
  vaultAddress: \"0xe75d77b1865ae93c7eaa3040b038d7aa7bc02f70\",
}]" > flux-args.js
npx hardhat --network mainnet verify --contract contracts/strategies/FluxStrategy.sol:FluxStrategy --constructor-args flux-args.js 0x57d49c28Cf9A0f65B1279a97eD01C3e49a5A173f

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shahthepro
shahthepro previously approved these changes Oct 9, 2025
@sparrowDom sparrowDom dismissed stale reviews from naddison36 and shahthepro via 279bfaa October 17, 2025 09:07
@sparrowDom sparrowDom merged commit a8b7593 into master Oct 17, 2025
10 of 14 checks passed
@sparrowDom sparrowDom deleted the sparrowDom/etherscanVerifyWorkaround branch October 17, 2025 09:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants